# surfparc_mass_images_20070917.bash
# mass images

subjectsdir=/home/liang/Projects/ASD_QC/Results
restdir=/home/liang/Projects/ASD_QC/DataProcessed/rest
scriptdir=/home/liang/Projects/ASD_QC/Scripts/figures
pardir=/home/liang/Projects/ASD_QC/Results/fs4_data/conf_3/IndiPar

function onehemi() {
  hemi=$1
  mghfile=$2

  tksurfer fsaverage4 $hemi pial -overlay $mghfile -tcl $scriptdir"/surfparc_makeimages.tcl" -fminmax 0.835 0.955
}

function onesubject() {
  sbjid=$1

  echo "========================================"
  echo "            "$sbjid
  echo "========================================"

  # lhmghfile="lh_"$type"_"$sbjid"_fs4_"$datasource"_variability.mgh"
  # onehemi lh $subjectsdir"/Variability/"$lhmghfile
  #
  # rhmghfile="rh_"$type"_"$sbjid"_fs4_"$datasource"_variability.mgh"
  # onehemi rh $subjectsdir"/Variability/"$rhmghfile

  desdir=$screencapdir"/"$sbjid
  mkdir $desdir

  for((i=1;i<=10;i++));
  do
    tarlhfile=$pardir"/"$sbjid"/Iter_"$i"/Network_17_lh.mgh"
    onehemi lh $tarlhfile
    tarrhfile=$pardir"/"$sbjid"/Iter_"$i"/Network_17_rh.mgh"
    onehemi rh $tarrhfile

    desiterdir=$desdir"/Iter_"$i
    mkdir $desiterdir

    mv $screencapdir"/"*".tif" $desiterdir
  done
}

screencapdir=$subjectsdir"/Screencaps"
mkdir $screencapdir

onesubject OHSU2_28940
onesubject OHSU2_28982
onesubject OHSU2_28998
onesubject OHSU2_28958
onesubject OHSU2_28936
onesubject OHSU2_28924
onesubject OHSU2_28935
onesubject OHSU2_28939
onesubject OHSU2_28925
onesubject OHSU2_28995
